<me:UIMUX x:Class="WPFExcelReport.TMCO07"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport"     
                     xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    x:Name="TV"
                    FTAUTOSUM="True" 
                   SKEY1="ABAMANDANT" 
                     KEY1="VQTYSTDPRSTD"      
                    Loaded="Window_Loaded"
     >
    <me:UIMUX.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby10000  x:Key="dw"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>  
    </me:UIMUX.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <TextBlock Text="{Binding DES,ElementName=TV}" Margin="10,0,0,0"/>
            <WrapPanel Visibility="Collapsed">
                <Button Grid.Row="0" Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="20" BorderBrush="White">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Reload.png" />
                    </Button.Background>
                </Button>
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=总成本:}}"  Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding SUM1, Converter={StaticResource dw}}" Foreground="Red" Margin="10,0,0,0"/>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=w}}"  Margin="1,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=纱线:}}"  Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding ABAART, Converter={StaticResource gb2312}}"   Margin="10,0,0,0"/>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=用量:}}"  Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding QTYSTD}"   Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=单价:}}"  Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding PRSTD}"   Margin="10,0,0,0"/> 
                </WrapPanel>
            </WrapPanel>
        </StackPanel>
        <DataGrid  Grid.Row="1"  Grid.Column="0"
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column" 
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   Visibility="{Binding IsShowGrid,ElementName=TV,Converter={StaticResource bv}}"
                   x:Name="dlgMaster"
                   RowDetailsVisibilityMode="Visible"  Margin="0,0.2,0.2,0"
                   >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=ABAART,Converter={StaticResource ResourceKey=gb2312}, Mode=TwoWay}"  Header="{Binding Source={Localization:Translate Word=原料}}" Width="150" />
                 <DataGridTextColumn Binding="{Binding Path=QTYSTD}"  Header="{Binding Source={Localization:Translate Word=用量}}" Width="Auto" />
                 <DataGridTextColumn Binding="{Binding Path=PRSTD,Converter={StaticResource dw}}"   Header="{Binding Source={Localization:Translate Word=单价}}" Width="Auto" />
                 <DataGridTextColumn Binding="{Binding Path=VQTYSTDPRSTD}" Header="{Binding Source={Localization:Translate Word=标准成本}}" Width="Auto" /> 
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</me:UIMUX>
